package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 道具表
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_prop")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuProp extends Model<GuProp> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "prop_id", type = IdType.AUTO)
    private Integer propId;

    /**
     * 道具名称
     */
    private String propName;

    /**
     * 道具图片
     */
    private String propImage;

    /**
     * 道具描述
     */
    private String propDesc;

    /**
     * 排序越小越靠前
     */
    private Integer propSort;

    /**
     * 创建时间
     */
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime propExpirationTime;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private Integer propNum;

    @TableField(exist = false)
    private Integer canUseNum;

    @TableField(exist = false)
    private Long pnId;

    @TableField(exist = false)
    private Integer propState;


    @Override
    protected Serializable pkVal() {
        return this.propId;
    }

}
